<%@page import="study.top.mydb.items.MemberItem"%>
<%@page import="study.top.mydb.items.Category2Item"%>
<%@page import="study.top.mydb.Category2"%>
<%@page import="study.top.mydb.items.Category1Item"%>
<%@page import="study.top.mydb.items.ProductItem"%>
<%@page import="study.top.mydb.Category1"%>
<%@page import="java.util.ArrayList"%>
<%@page import="study.top.mydb.Product"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page trimDirectiveWhitespaces="true"%>

<% 
	boolean login = false;
	int mem_seq = 0;

	MemberItem memberItem = (MemberItem) session
			.getAttribute("MemberItem");

	if (memberItem != null) {
		login = true;
		mem_seq = memberItem.getSeq();
	}

	db.connect();

	Product product = new Product();
	ArrayList<ProductItem> ProductItem_list = product.Top3list(3);

	Category1 category1 = new Category1();
	ArrayList<Category1Item> category1_list = category1
			.selectCategory1List();
%>
<!-- Top 버튼 -->
	<div class="top-td top-hidden-xs">
<div style="display: scroll; position: fixed; bottom: 5px; right: 5px;">
	<a onclick="go_top();" title=Top><img src=img/top.png></a>
</div>
</div>
<!-- Top 버튼 -->


	<div class="top-main-header"></div>
	<br /> <br />



	<div style="margin-left: 70px;">
		<a class="addthis_button_favorites"><img src="img/star.jpg"
			alt="Favorites" /></a>
		<script type="text/javascript"
			src="http://s7.addthis.com/js/250/addthis_widget.js?pub=xa-4a65e1d93cd75e94"></script>
	</div>



	<div class="text-center">
		<a href="topmainpage.jsp" title="우선블랙핏"><img
			src="img/topmain2.jpg" alt="메인"></a>
	</div>


<div style="margin-left: 70px;">
		<div class="text-left">
			<div class="top-td top-hidden-xs">
		<a href="topmainpage.jsp" title="우선블랙핏"><img src="img/home.jpg"
				alt="메인"></a> 
			<%
				if (!login) {
			%>
			<a href="uMemLogin.jsp" title="우선블랙핏"><img src="img/login.jpg"
				alt="메인"></a> <a href="uMemAdd.jsp" title="우선블랙핏"><img
				src="img/join.jpg" alt="메인"></a>
			<%
				} else {
			%>
			<a href="uMemLogout.jsp" title="우선블랙핏"><img src="img/logout.png"
				alt="메인"></a>
			<%
				}
			%>
		</div>
	</div>
</div>





	<div style="margin-right: 50px;">
		<div class="text-right">
		<div class="top-td top-hidden-xs">
			<a href="uBrdMyReviewlistAll.jsp" title="우선블랙핏"><img src="img/review.jpg"
				alt="메인"></a> 
			<a href="uMemMypage.jsp" title="우선블랙핏"><img src="img/mypage.jpg"
				alt="메인"></a> <a href="nBoardList.jsp" title="우선블랙핏"><img
				src="img/notice.png" alt="메인"></a> <a href="uBrdQAlist.jsp"
				title="우선블랙핏"><img src="img/Q&A.png" alt="메인"></a>
				
</div>

		</div>
	</div>


<div class="top-hidden-xs">

<br />
<br />

	<div class="top-body-header"></div>


</div>


	<br />
			<br />
<!-- *****************여기까지가 검색창 소스 ***********************-->


		<!-- 메뉴바 -->
		<nav class="navbar navbar-default" role="navigation">
	<div class="navbar-header">
						<a class="navbar-brand" href="#">CATEGORY</a>
					
					<!-- 로고 -->
					<div class="navbar-header">
					
					<!--반응형 메뉴 구현 기능 추가-->
					<button type="button" class="navbar-toggle"
					data-toggle="collapse" data-target=".navbar-collapse">
						<span class="sr-only">메뉴열기</span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
					</button>			
					<!--반응형 메뉴 구현 기능 끝-->
					</div>
</div>

			<!-- 메뉴 항목 -->
			<div class="collapse navbar-collapse">

				<ul class="nav navbar-nav">
					<%
						for (int i = 0; i < category1_list.size(); i++) {
							Category1Item Category1_item = category1_list.get(i);
							int i_seq = Category1_item.getSeq();
					%>

				<li> <a
						style="font-family: inherit; font-weight: bolder; font-size: 10px;"
						href="#" onmouseout="this.innerHTML=t();" class="dropdown-toggle"
						data-toggle="dropdown">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
							&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
							&nbsp;&nbsp;&nbsp;&nbsp;<%=Category1_item.getC1_name()%>
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							&nbsp;&nbsp;&nbsp; &nbsp;<b class="caret"></b>

					</a>
					
						<ul class="dropdown-menu">

							<%
								Category2 category2 = new Category2();
									ArrayList<Category2Item> category2_list = category2
											.selectCategory2List(i_seq);
									for (int j = 0; j < category2_list.size(); j++) {
										Category2Item Category2_item = category2_list.get(j);
							%>


							<li><a href="uProductList.jsp?page=1&c1=<%=Category2_item.getC1_seq()%>&c2=<%=Category2_item.getSeq()%>">
									<%=Category2_item.getC2_name()%>
							</a></li>
							<%
								}
							%>

						</ul></li>

					<%
						}
						db.disconnect();
					%>

				</ul>
			
			<hr size="3" width="100%" />
			
		</div>
		
		<div class="top-last-header"></div>
	</nav>
	
